<template>
<div class="header">
    
    <span class="title">
        <a v-if="isBack" class="back" @click="goBack"><Icon type="ios-arrow-back" />返回<Divider type="vertical" /></a>
        {{title}}
    </span>
    <div class="buts">
        <slot name="but"></slot>
    </div>
</div>
</template>

<script>
export default {
    props:{
        title: String,
        isBack: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {

        }
    },
    methods: {
        goBack() {
            window.history.length > 1 ? this.$router.go(-1) : this.$router.push('/')
        },
    }
}
</script>

<style lang="less" scoped>
.header {
    display: flex;
    background-color: #FFF;
    width: 100%;
    height: 50px;
    border-bottom: @border-width-base @border-style-base @border-color-base;
    padding: 0px 10px;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0px;
    left: 0px;
    z-index: 999;

    .title {
        line-height: 49px;
        font-size: 16px;

        .back{
            font-size: 14px;
        }
    }

    /deep/ .buts Button{
        margin-right: 5px;
    }
}
</style>
